import numpy as np

def define_nodes_and_elements(num_nodes, R, theta, h):
    nodes_angle = np.linspace(0, theta, num_nodes)  # 均匀分布角度
    nodes_height = np.linspace(0, h, num_nodes)  # 高度变化
    nodes = np.array([[R * np.cos(ang), R * np.sin(ang), z] for ang, z in zip(nodes_angle, nodes_height)])
    elements = np.array([[i, i + 1] for i in range(num_nodes - 1)])
    return nodes, elements, nodes_angle
